********************************************************************************
* Terrorism, perpetrators and polarization: Evidence from natural experiments 
* BY BOVE, DI LEO, EFTHYVOULOU & PICKARD
* REPLICATION FILE: MASTER DO-FILE
********************************************************************************

***Note for the replicator: Figure 4 cannot be replicated as it employs proprietary data from Twitter, so we cannot share the data. 

***Note for the replicator: Figure C.13a cannot be replicated as it employs proprietary data from Twitter, so we cannot share the data. 

*The data for both Figures can be downloaded from Twitter, using the API: https://developer.twitter.com/en/docs/twitter-api


***Note: replicators should install the following packages by uncommenting this section
/*
ssc install reghdfe, replace 
ssc install ebalance, replace
ssc install center, replace
ssc install estout, replace
ssc install grstyle, replace
ssc install coefplot, replace
ssc install kountry, replace
ssc install rangestat, replace
ssc install rangejoin, replace 
ssc install nearmrg, replace
ssc install copydesc, replace
net install scheme-hp, from("https://raw.githubusercontent.com/harrypickard/stata-scheme-hp/main/") replace
*/


*Note: replicators should set directory to open data 
*cd ""

*set scheme for figures' style
set scheme hp

*clear preexisting data
clear all

*turn graphic elaboration off
set graphics off



####Replicates the main paper
do "1. main_paper.do"


####Replicates the online appendix
do "2. appendix.do"